#ifndef FPGA_SUBS_H
#define FPGA_SUBS_H

#include <QWidget>
#include <QLineEdit>
#include <QTableWidget>
#include "../MACRO.h"
namespace Ui {
class fpga_subs;
}

class fpga_subs : public QWidget
{
    Q_OBJECT

public:
    explicit fpga_subs(QWidget *parent = nullptr
                       ,int dev_numb = 0
                        ,QString dev_name = "xc7s");
    ~fpga_subs();

private:
    Ui::fpga_subs *ui;
private:
    QTableWidget *table;
    QTableWidget *table_state;

public slots:
    void update_file_path(QList<QString>);
private slots:
    void on_ui_rd_param_clicked();

    void on_ui_wr_param_clicked();

    void on_ui_close_clicked();

private:
    QString p_fpga_file;
    QList<QString>l_fpga_set;
    QList<QString>l_fpga_info;
    QList<QString>l_fpga_state;
    QList<QString>l_fpga_state_info;

    const int row    = 32;
    const int column = 4 ;
    int dev_numb_tmp;
    QString dev_name_temp;
signals:
    void info_trig(quint32,quint32,QString,QString);
    void udp_trig(QString,quint32);
    void uart_trig(QString,quint32);
    // --------------------------------------------
    // add data change
private slots:
    void on_ui_table_cellClicked(int row,int column);
    void on_ui_reset_state_clicked();

    void on_ui_update_still_clicked();

signals:
    void hex_trig(quint32 hex,quint32 dec,quint32 bit);
    //add state data update
public slots:
    void update_state_data(QList<quint32>,quint32);
private:
    bool state_update_still_flg;
    int cur_row;
    int cur_column;
signals:
    void scene_to_wave();
    // --------------------------------------------
    // add device temp
private:
    quint32 DEV_CODE_FPGA_SET          =0x0;
    quint32 DEV_CODE_UART_PL           =0x0;
    quint32 DEV_CODE_UART_PL_CAMERA    =0x0;
    quint32 DEV_CODE_FPGA_STATE        =0x0;
};

#endif // FPGA_SUBS_H
